Skip to content

Conversation

@YueRen
Copy link
Member

@YueRen YueRen commented Sep 30, 2025

added function to make variable names singular compatible. fixes #5392

added function to make variable names singular compatible.
fixes oscar-system#5392
@YueRen YueRen added topic: tropical geometry release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes labels Sep 30, 2025
@fieker
Copy link
Contributor

fieker commented Oct 1, 2025

apart from this working, this is still a cludge

@benlorenz
Copy link
Member

Can you add the example from the issue as a testcase?

@YueRen
Copy link
Member Author

YueRen commented Oct 2, 2025

Can you add the example from the issue as a testcase?

Is done!

YueRen and others added 2 commits October 10, 2025 13:37
removed the conversion of Oscar ideal to Singular via string
@YueRen
Copy link
Member Author

YueRen commented Oct 10, 2025

I've now replaced the original dirty hack with the suggestion by @fingolfin. No conversion of an OSCAR ideal to a Singular string necessary anymore, but the need to call the Singular interpreter and the conversion of a Singular fan string to an OSCAR polyhedral complex remain.

@YueRen YueRen force-pushed the yr/tropicalVarietySingular branch from 4f3baaa to 032aae9 Compare October 14, 2025 10:56
@YueRen
Copy link
Member Author

YueRen commented Oct 15, 2025

@fingolfin Everything should be using Singular.low_level_caller now.

@fingolfin
Copy link
Member

Thanks @YueRen this looks good. Unfortunately it seems to cause a crash :-( in CI, in the doctests:

page: src/TropicalGeometry/variety.jl:74-96
  0.132471 seconds (35.74 k allocations: 2.843 MiB, 56.50% compilation time)
page: src/TropicalGeometry/variety.jl:167-220
/home/runner/work/_temp/d5e2334b-f0b4-40c5-a276-f9262c06c6fc.sh: line 7:  2263 Segmentation fault      (core dumped)

@fingolfin fingolfin closed this Nov 5, 2025
@fingolfin fingolfin reopened this Nov 5, 2025
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.98%. Comparing base (3b0a632) to head (169a03a).
⚠️ Report is 98 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5397      +/-   ##
==========================================
- Coverage   84.20%   77.98%   -6.23%     
==========================================
  Files         717      731      +14     
  Lines       97992   103333    +5341     
==========================================
- Hits        82519    80589    -1930     
- Misses      15473    22744    +7271     
Files with missing lines Coverage Δ
src/Oscar.jl 63.75% <100.00%> (+0.92%) ⬆️
src/TropicalGeometry/variety.jl 80.43% <ø> (-6.53%) ⬇️
src/TropicalGeometry/variety_prime.jl 88.70% <100.00%> (+20.52%) ⬆️

... and 284 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fingolfin
Copy link
Member

The crash is in a doctest in src/TropicalGeometry/variety.jl. I reproduced it locally and narrowed it down to this example:

julia> K,t = rational_function_field(GF(101),:t);

julia> R,(x,y,z) = K["x","y","z"];

julia> nu_2 = tropical_semiring_map(QQ,2)
Map into Min tropical semiring encoding the 2-adic valuation on Rational field

julia> f1 = 8*x^2 + x*y + x*z + x + 8*y^2 + y*z + y + 8*z^2 + z + 8;

julia> f2 = x + 2;

julia> I = ideal([f1,f2]);

julia> TropI_2 = tropical_variety(I,nu_2; skip_saturation=true, skip_decomposition=true)

[76002] signal 11 (2): Segmentation fault: 11
in expression starting at REPL[13]:1
unknown function (ip: 0x0) at (unknown file)
Allocations: 99607851 (Pool: 99573602; Big: 34249); GC: 34
/Users/mhorn/.local/bin/j12: line 2: 76002 Segmentation fault: 11  julia +1.12 --proj=p/1.12 "$@"

Debugger backtrace:

(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x0000000000000000
    frame #1: 0x0000000333208bd8 libSingular-4.4.1.dylib`tropicalStrategy::tropicalStrategy(sip_sideal*, snumber*, ip_sring*) + 1528
    frame #2: 0x000000033321c3d0 libSingular-4.4.1.dylib`tropicalVariety(sleftv*, sleftv*) + 1920
    frame #3: 0x0000000333166ab0 libSingular-4.4.1.dylib`iiMake_proc(idrec*, sip_package*, sleftv*) + 320
    frame #4: 0x000000033312724c libSingular-4.4.1.dylib`jjPROC(sleftv*, sleftv*, sleftv*) + 220
    frame #5: 0x000000033312edf0 libSingular-4.4.1.dylib`iiExprArith2TabIntern(sleftv*, sleftv*, int, sleftv*, int, sValCmd2 const*, int, int, sConvertTypes const*) + 2096
    frame #6: 0x000000033312f904 libSingular-4.4.1.dylib`iiExprArith2(sleftv*, sleftv*, int, sleftv*, int) + 612
    frame #7: 0x0000000333153000 libSingular-4.4.1.dylib`jjKLAMMER_PL(sleftv*, sleftv*) + 176
    frame #8: 0x00000003331323c8 libSingular-4.4.1.dylib`iiExprArithM(sleftv*, sleftv*, int) + 952
    frame #9: 0x000000033312581c libSingular-4.4.1.dylib`yyparse() + 9596
    frame #10: 0x0000000333166420 libSingular-4.4.1.dylib`iiAllStart(procinfo*, char const*, feBufferTypes, int) + 272
    frame #11: 0x00000003331667e8 libSingular-4.4.1.dylib`iiPStart(idrec*, sleftv*) + 440
    frame #12: 0x0000000333166b70 libSingular-4.4.1.dylib`iiMake_proc(idrec*, sip_package*, sleftv*) + 512
    frame #13: 0x000000033312724c libSingular-4.4.1.dylib`jjPROC(sleftv*, sleftv*, sleftv*) + 220
    frame #14: 0x000000033312edf0 libSingular-4.4.1.dylib`iiExprArith2TabIntern(sleftv*, sleftv*, int, sleftv*, int, sValCmd2 const*, int, int, sConvertTypes const*) + 2096
    frame #15: 0x000000033312f904 libSingular-4.4.1.dylib`iiExprArith2(sleftv*, sleftv*, int, sleftv*, int) + 612
    frame #16: 0x0000000333153000 libSingular-4.4.1.dylib`jjKLAMMER_PL(sleftv*, sleftv*) + 176
    frame #17: 0x00000003331323c8 libSingular-4.4.1.dylib`iiExprArithM(sleftv*, sleftv*, int) + 952
    frame #18: 0x000000033312581c libSingular-4.4.1.dylib`yyparse() + 9596
    frame #19: 0x0000000333166420 libSingular-4.4.1.dylib`iiAllStart(procinfo*, char const*, feBufferTypes, int) + 272
    frame #20: 0x00000003331667e8 libSingular-4.4.1.dylib`iiPStart(idrec*, sleftv*) + 440
    frame #21: 0x0000000333166b70 libSingular-4.4.1.dylib`iiMake_proc(idrec*, sip_package*, sleftv*) + 512
    frame #22: 0x00000003331679cc libSingular-4.4.1.dylib`ii_CallLibProcM(char const*, void**, int*, ip_sring*, int&) + 492
    frame #23: 0x0000000333e202c8 libsingular_julia.dylib`call_singular_library_procedure(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, ip_sring*, jlcxx::ArrayRef<_jl_value_t*, 1>) + 280
    frame #24: 0x0000000333e249ac libsingular_julia.dylib`std::__1::__function::__func<_jl_value_t* (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, ip_sring*, jlcxx::ArrayRef<_jl_value_t*, 1>), std::__1::allocator<_jl_value_t* (*)(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, ip_sring*, jlcxx::ArrayRef<_jl_value_t*, 1>)>, _jl_value_t* (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, ip_sring*, jlcxx::ArrayRef<_jl_value_t*, 1>)>::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&&, ip_sring*&&, jlcxx::ArrayRef<_jl_value_t*, 1>&&) + 60
    frame #25: 0x0000000333e2481c libsingular_julia.dylib`jlcxx::detail::CallFunctor<_jl_value_t*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, ip_sring*, jlcxx::ArrayRef<_jl_value_t*, 1>>::apply(void const*, jlcxx::WrappedCppPtr, jlcxx::WrappedCppPtr, jl_array_t*) + 92
    frame #26: 0x00000003d6eb4094
    frame #27: 0x00000001016416a0 libjulia-internal.1.12.1.dylib`eval_stmt_value(stmt=<unavailable>, s=<unavailable>) at interpreter.c:194:23 [opt]
    frame #28: 0x0000000101640320 libjulia-internal.1.12.1.dylib`eval_body(stmts=<unavailable>, s=0x000000016ef84560, ip=<unavailable>, toplevel=1) at interpreter.c:689:21 [opt]
    frame #29: 0x000000010164097c libjulia-internal.1.12.1.dylib`jl_interpret_toplevel_thunk(m=0x000000011c141fb0, src=0x0000000364ce6410) at interpreter.c:898:21 [opt]
    frame #30: 0x000000010165b338 libjulia-internal.1.12.1.dylib`jl_toplevel_eval_flex(m=0x000000011c141fb0, e=<unavailable>, fast=1, expanded=1, toplevel_filename=<unavailable>, toplevel_lineno=0x000000033e40f3b0) at toplevel.c:1035:18 [opt]
    frame #31: 0x0000000113e8748c u0gqU_vMi9E.dylib`japi1___repl_entry_eval_expanded_with_loc_19063.1 at REPL.jl:301
    frame #32: 0x000000010162d0ac libjulia-internal.1.12.1.dylib`jl_apply(args=<unavailable>, nargs=5) at julia.h:2391:12 [opt] [inlined]
    frame #33: 0x000000010162d09c libjulia-internal.1.12.1.dylib`jl_f_invokelatest(F=<unavailable>, args=<unavailable>, nargs=5) at builtins.c:881:23 [opt]
    frame #34: 0x000000011171c0f0
(lldb)

Perhaps @hannes14 or @YueRen can make something out of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes topic: tropical geometry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tropical_variety not working for Gr(2,5)

6 participants